I uploaded two python scripts (retrain.py, predict.py) to our scorpion server.
|- training_images|- cat|- image_0.jpg|- image_1.jpg...|- dog|- image_2.jpg|- image_3.jpg...
|- testing_images|- image_0.jpg|- image_1.jpg|- image_2.jpg|- image_3.jpg...
ssh to scorpion and cd to the folder:
> ssh chuah@scorpion> cd /home/chuah/xincoder/retrain_object_classifier> mkdir models
Assume that both "training_images" and "testing_images" are in this folder:
> lsmodels/ predict.py retrain.py testing_images/ training_images/
Then, we can type the following command to starting training process:
> python retrain.py \--bottleneck_dir=./bottlenecks \--how_many_training_steps=50000 \--model_dir=./inception \--output_graph=./models/retrained_graph.pb \--output_labels=./models/retrained_labels.txt \--summaries_dir=./retrain_logs \--validation_batch_size=5000 \--image_dir=training_images # this is the folder of training data
After this training process finished, it saves the trained model in "./models".
> ls modelsretrained_graph.pb retrained_labels.txt
Type the following command in a terminal to run the testing code:
> python predict.py \--models_folder='./models' \--test_image_folder='./testing_images' \--display_image=False
Next: 2. Use trained model in Android, Up: Index